﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Entities.ThuQuy;

namespace WindowsForms.ThuQuy
{
    public partial class InBaoCao : Form
    {
        public InBaoCao()
        {
            InitializeComponent();
            LoadCbbBaoCao(BaoCao.Objects.All().ToList());
        }

        public void LoadCbbBaoCao(List<BaoCao> list)
        {
            foreach (var item in list)
                cbbMaBaoCao.Items.Add(item);
            cbbMaBaoCao.DisplayMember = "MaBaoCao";
            cbbMaBaoCao.ValueMember = "MaBaoCao";
            cbbMaBaoCao.Items.Insert(0, "-------Chọn báo cáo-------");
            cbbMaBaoCao.SelectedIndex = 0;
        }

        private void InBaoCao_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'datasetQLGiaiBongda.InBaoCao' table. You can move, or remove it, as needed.
            //this.inBaoCaoTableAdapter.Fill(this.datasetQLGiaiBongda.InBaoCao);
            // TODO: This line of code loads data into the 'datasetQLGiaiBongda.InBaoCao' table. You can move, or remove it, as needed.
            
        }

        private void btnIn_Click(object sender, EventArgs e)
        {
            this.inBaoCaoTableAdapter.Fill(this.datasetQLGiaiBongda.InBaoCao,cbbMaBaoCao.Text);

            this.reportViewer1.RefreshReport();
        }
    }
}
